<?php
namespace api\user\service;
use api\user\service\UserServer\AgentStrategy;
use api\user\service\UserServer\AdminStrategy;
// use cmf\controller\RestBaseController;

class UserServer
{
    //策略对象
    private $strategy;
    public $success = 0;
    //获取具体策略
    public function getStrategy($strategyName)
    {
        try {
            $strategyReflection = new \ReflectionClass('api\user\service\UserServer\\'.$strategyName);
            $this->strategy = $strategyReflection->newInstance();

        } catch (ReflectionException $e) {
            $this->strategy = "";
        }
    }

    /**
     * [createUser 创建用户]
     * @Author   HUI
     * @DateTime 2019-01-07
     * @version  [version]
     * @return   [type]     [description]
     */

    public function addUser($data = [])
    {
        //
       return  $this->strategy->createUser($data);
    }

    public function editPost($data = [])
    {
        return  $this->strategy->editUser($data);
    }


    public function killUser($data = [])
    {
       return  $this->strategy->killUser($data);
    }

    public function releaseUser($data = [])
    {
        return $this->strategy->releaseUser($data);
    }

     public function getUserInfo($data = [])
    {
        return $this->strategy->getUserInfo($data);
    }

     public function getAllUser($data = [])
    {
       return $this->strategy->getAllUser($data);
        // print_r($res);exit();
        // return $this->strategy->getAllUser($data);
    }



}
